home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / dosutils / tsbat50.zip / DAILY.BAT < prev    next >
DOS Batch File  |  1992-09-16  |  1KB  |  53 lines

  1. echo off
  2. echo.
  3. echo ┌───────────────────────────────────────────────────┐
  4. echo │ Run a program only once a day at boot time        │
  5. echo │ By Prof. Timo Salmi, ts@uwasa.fi, Wed 16-Sep-1992 │
  6. echo └───────────────────────────────────────────────────┘
  7.  
  8. if "%1"=="" goto _help
  9.  
  10. rem What date was this bacth last run
  11. if exist date1$$$ goto _date_now
  12. echo Not yet run today > date1$$$
  13.  
  14. :_date_now
  15. rem What is the current date
  16. echo.|date > date2$$$
  17.  
  18. rem Compare the last and the current date
  19. fc date2$$$ date1$$$ > tmp$$$
  20. type tmp$$$ | find "no differences encountered" > same$$$
  21. del tmp$$$
  22. if exist doit$$$ del doit$$$
  23. copy same$$$ dont$$$ > nul
  24. del same$$$
  25.  
  26. rem Move the current date information to the last run date variable
  27. copy date2$$$ date1$$$ > nul
  28. del date2$$$
  29.  
  30. rem Don't run if the dates match
  31. if exist dont$$$ goto _done
  32.  
  33. rem Make the call
  34. call %1 %2 %3 %4 %5 %6 %7 %8 %9
  35. goto _out
  36.  
  37. :_help
  38. echo.
  39. echo If you want to run a program only once a day when you reboot
  40. echo your computer, put
  41. echo.
  42. echo   CALL DAILY YourApplicationName [Param1] [Param2] [...]
  43. echo.
  44. echo in your autoexec.bat file.
  45. echo.
  46. goto _out
  47.  
  48. :_done
  49. del dont$$$
  50. echo %0 has already been run today
  51.  
  52. :_out
  53.